<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>需求列表 | SocialDemand</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <!-- 引入Select2用于高级筛选 -->
    <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet">
    
    <style>
        :root {
            --primary: #4f46e5;
            --primary-light: #818cf8;
            --primary-bg: #f0f9ff;
            --secondary: #64748b;
            --light: #f8fafc;
            --dark: #1e293b;
            --danger: #ef4444;
            --success: #10b981;
            --warning: #f59e0b;
            --border: #e2e8f0;
            --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            --radius: 8px;
            --transition: all 0.3s ease;
        }
        
        body {
            font-family: 'Inter', system-ui, sans-serif;
            background-color: #f8fafc;
            color: var(--dark);
            line-height: 1.6;
        }
        
        .container {
            max-width: 1320px;
        }
        
        /* 导航栏 */
        .navbar {
            background-color: white;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
            padding: 0.75rem 0;
            position: sticky;
            top: 0;
            z-index: 1030;
        }
        
        .logo {
            font-weight: 700;
            font-size: 1.5rem;
            color: var(--primary);
            text-decoration: none;
        }
        
        .search-container {
            position: relative;
            max-width: 500px;
            width: 100%;
        }
        
        .search-input {
            width: 100%;
            padding: 0.5rem 1rem 0.5rem 2.5rem;
            border: 1px solid var(--border);
            border-radius: 6px;
            font-size: 0.9rem;
            transition: var(--transition);
        }
        
        .search-input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
        }
        
        .search-icon {
            position: absolute;
            left: 0.75rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--secondary);
        }
        
        .nav-icon {
            font-size: 1.25rem;
            color: var(--secondary);
            transition: var(--transition);
        }
        
        .nav-icon:hover {
            color: var(--primary);
        }
        
        /* 筛选区域 */
        .filters-section {
            background-color: white;
            padding: 1.5rem;
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            margin: 1.5rem 0;
        }
        
        .filter-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }
        
        .filter-title {
            font-size: 1.25rem;
            font-weight: 600;
        }
        
        .filter-toggle {
            color: var(--primary);
            background: none;
            border: none;
            display: flex;
            align-items: center;
            gap: 0.25rem;
            font-size: 0.9rem;
        }
        
        .filter-row {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            margin-bottom: 1rem;
        }
        
        .filter-group {
            flex: 1;
            min-width: 200px;
        }
        
        .filter-label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 500;
            font-size: 0.9rem;
        }
        
        .filter-select, .filter-input {
            width: 100%;
            padding: 0.5rem 0.75rem;
            border: 1px solid var(--border);
            border-radius: 6px;
            font-size: 0.9rem;
            transition: var(--transition);
        }
        
        .filter-select:focus, .filter-input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
        }
        
        .filter-actions {
            display: flex;
            justify-content: flex-end;
            gap: 1rem;
            margin-top: 1rem;
        }
        
        .btn-reset {
            background-color: var(--light);
            color: var(--secondary);
            border: 1px solid var(--border);
        }
        
        .btn-reset:hover {
            background-color: #e2e8f0;
            color: var(--dark);
        }
        
        .btn-apply {
            background-color: var(--primary);
            color: white;
            border: none;
        }
        
        .btn-apply:hover {
            background-color: #4338ca;
            color: white;
        }
        
        /* 快速筛选标签 */
        .quick-filters {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--border);
        }
        
        .quick-filter {
            padding: 0.5rem 1.25rem;
            background-color: white;
            border-radius: 20px;
            border: 1px solid var(--border);
            white-space: nowrap;
            font-size: 0.9rem;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .quick-filter:hover, .quick-filter.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        .quick-filter .remove-filter {
            display: none;
            cursor: pointer;
        }
        
        .quick-filter.active .remove-filter {
            display: inline-block;
        }
        
        /* 结果统计 */
        .results-stats {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }
        
        .results-count {
            color: var(--secondary);
            font-size: 0.95rem;
        }
        
        .sort-options {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .sort-label {
            font-size: 0.95rem;
            color: var(--secondary);
        }
        
        /* 主内容区 */
        .main-content {
            padding: 2rem 0;
        }
        
        .section-title {
            font-size: 1.75rem;
            font-weight: 600;
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        /* 需求卡片通用样式 */
        .demand-card {
            background-color: white;
            border-radius: var(--radius);
            overflow: hidden;
            box-shadow: var(--shadow);
            transition: var(--transition);
            margin-bottom: 1.5rem;
        }
        
        .demand-card:hover {
            transform: translateY(-3px);
            box-shadow: var(--shadow-hover);
        }
        
        .demand-header {
            padding: 1rem;
            border-bottom: 1px solid var(--border);
        }
        
        .demand-author {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }
        
        .author-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .author-info {
            flex: 1;
        }
        
        .author-name {
            font-weight: 500;
            font-size: 0.95rem;
        }
        
        .post-time {
            font-size: 0.8rem;
            color: var(--secondary);
        }
        
        .demand-content {
            padding: 1rem;
        }
        
        .demand-title {
            font-size: 1.25rem;
            font-weight: 600;
            margin-bottom: 0.75rem;
            line-height: 1.4;
        }
        
        .demand-description {
            color: var(--dark);
            margin-bottom: 1rem;
            line-height: 1.6;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        .demand-footer {
            padding: 0.75rem 1rem;
            border-top: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.9rem;
        }
        
        .demand-stats {
            display: flex;
            gap: 1.5rem;
        }
        
        .stat-item {
            display: flex;
            align-items: center;
            gap: 0.35rem;
            color: var(--secondary);
        }
        
        .demand-actions {
            display: flex;
            gap: 1rem;
        }
        
        .action-btn {
            background: none;
            border: none;
            display: flex;
            align-items: center;
            gap: 0.35rem;
            color: var(--secondary);
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            transition: var(--transition);
        }
        
        .action-btn:hover {
            background-color: var(--primary-bg);
            color: var(--primary);
        }
        
        .action-btn.liked {
            color: var(--danger);
        }
        
        .action-btn.saved {
            color: var(--primary);
        }
        
        /* 布局1: 无图片 */
        .demand-no-image .demand-content {
            padding-bottom: 0;
        }
        
        /* 布局2: 单张图片 */
        .demand-single-image .image-container {
            width: 100%;
            max-height: 300px;
            overflow: hidden;
        }
        
        .demand-single-image .demand-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: var(--transition);
        }
        
        .demand-single-image:hover .demand-image {
            transform: scale(1.02);
        }
        
        /* 布局3: 左侧图片右侧内容 */
        .demand-side-by-side {
            display: flex;
            flex-direction: column;
        }
        
        @media (min-width: 768px) {
            .demand-side-by-side {
                flex-direction: row;
            }
            
            .demand-side-by-side .image-container {
                width: 30%;
                height: auto;
            }
            
            .demand-side-by-side .content-wrapper {
                width: 70%;
                display: flex;
                flex-direction: column;
            }
            
            .demand-side-by-side .demand-header,
            .demand-side-by-side .demand-content,
            .demand-side-by-side .demand-footer {
                width: 100%;
            }
        }
        
        .demand-side-by-side .image-container {
            width: 100%;
            height: 180px;
        }
        
        .demand-side-by-side .demand-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        /* 标签样式 */
        .tags {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 1rem;
        }
        
        .tag {
            background-color: var(--primary-bg);
            color: var(--primary);
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
            font-size: 0.85rem;
            font-weight: 500;
        }
        

        /* 分页样式 */
        .pagination-container {
            display: flex;
            justify-content: center;
            margin: 2rem 0;
        }
        
        .pagination {
            display: flex;
            gap: 0.5rem;
        }
        
        .page-item .page-link {
            color: var(--primary);
            border: 1px solid var(--border);
            border-radius: 6px;
            padding: 0.5rem 1rem;
        }
        
        .page-item.active .page-link {
            background-color: var(--primary);
            border-color: var(--primary);
            color: white;
        }
        
        .page-item.disabled .page-link {
            color: var(--secondary);
            pointer-events: none;
        }
        
        /* 响应式调整 */
        @media (max-width: 768px) {
            .section-title {
                font-size: 1.5rem;
            }
            
            .demand-title {
                font-size: 1.15rem;
            }
            
            .demand-stats {
                gap: 1rem;
            }
            
            .demand-footer {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.75rem;
            }
            
            .demand-actions {
                width: 100%;
                justify-content: space-between;
            }
            
            .filter-row {
                flex-direction: column;
                gap: 1rem;
            }
            
            .quick-filters {
                padding-bottom: 0.5rem;
            }
        }
        
        @media (max-width: 576px) {
            .search-container {
                max-width: 100%;
            }
            
            .stat-item span:last-child {
                display: none;
            }
            
            .results-stats {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.5rem;
            }
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg">
        <div class="container">
            <a href="#" class="logo">SocialDemand</a>
            
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent">
                <i class="fas fa-bars"></i>
            </button>
            
            <div class="collapse navbar-collapse justify-content-center" id="navbarContent">
                <div class="d-flex search-container">
                    <i class="fas fa-search search-icon"></i>
                    <input type="text" class="search-input" placeholder="搜索需求、用户或标签...">
                </div>
            </div>
            
            <div class="d-flex gap-3 ms-3">
                <a href="#" class="nav-link nav-icon">
                    <i class="fas fa-home"></i>
                </a>
                <a href="#" class="nav-link nav-icon">
                    <i class="fas fa-bell"></i>
                </a>
                <a href="#" class="nav-link nav-icon">
                    <i class="fas fa-plus-circle"></i>
                </a>
                <a href="#" class="nav-link nav-icon">
                    <i class="fas fa-user-circle"></i>
                </a>
            </div>
        </div>
    </nav>
    
    <!-- 主内容区 -->
    <div class="main-content">
        <div class="container">
            <!-- 页面标题 -->
            <h2 class="section-title">
                <i class="fas fa-list-ul text-primary"></i> 需求列表
            </h2>
            
            <!-- 筛选区域 -->
            <div class="filters-section">
                <div class="filter-header">
                    <h3 class="filter-title">高级筛选</h3>
                    <button class="filter-toggle" id="toggleFilter">
                        <i class="fas fa-chevron-up"></i>
                        <span>收起筛选</span>
                    </button>
                </div>
                
                <div class="filter-content" id="filterContent">
                    <div class="filter-row">
                        <div class="filter-group">
                            <label class="filter-label">需求分类</label>
                            <select class="filter-select" id="categoryFilter" multiple="multiple">
                                <option value="skill">技能服务</option>
                                <option value="exchange">物品交换</option>
                                <option value="cooperation">创意合作</option>
                                <option value="activity">活动组织</option>
                                <option value="help">求助咨询</option>
                                <option value="job">求职招聘</option>
                                <option value="housing">租房买房</option>
                            </select>
                        </div>
                        
                        <div class="filter-group">
                            <label class="filter-label">发布时间</label>
                            <select class="filter-select" id="timeFilter">
                                <option value="all">不限</option>
                                <option value="today">今天</option>
                                <option value="week">近一周</option>
                                <option value="month">近一个月</option>
                                <option value="quarter">近三个月</option>
                            </select>
                        </div>
                        
                        <div class="filter-group">
                            <label class="filter-label">所在地区</label>
                            <select class="filter-select" id="locationFilter">
                                <option value="all">全国</option>
                                <option value="beijing">北京</option>
                                <option value="shanghai">上海</option>
                                <option value="guangzhou">广州</option>
                                <option value="shenzhen">深圳</option>
                                <option value="hangzhou">杭州</option>
                                <option value="chengdu">成都</option>
                                <option value="wuhan">武汉</option>
                            </select>
                        </div>
                    </div>
                    
                    <div class="filter-row">
                        <div class="filter-group">
                            <label class="filter-label">相关标签</label>
                            <select class="filter-select" id="tagFilter" multiple="multiple">
                                <option value="design">设计</option>
                                <option value="programming">编程</option>
                                <option value="photography">摄影</option>
                                <option value="handcraft">手工</option>
                                <option value="food">美食</option>
                                <option value="sports">运动</option>
                                <option value="study">学习</option>
                                <option value="travel">旅行</option>
                                <option value="pet">宠物</option>
                                <option value="charity">公益</option>
                            </select>
                        </div>
                        
                        <div class="filter-group">
                            <label class="filter-label">价格范围</label>
                            <div class="d-flex gap-2">
                                <input type="number" class="filter-input" placeholder="最低" id="minPrice">
                                <span class="align-self-center">-</span>
                                <input type="number" class="filter-input" placeholder="最高" id="maxPrice">
                            </div>
                        </div>
                        
                        <div class="filter-group">
                            <label class="filter-label">互动量</label>
                            <select class="filter-select" id="interactionFilter">
                                <option value="all">不限</option>
                                <option value="high">高互动</option>
                                <option value="medium">中等互动</option>
                                <option value="low">低互动</option>
                            </select>
                        </div>
                    </div>
                    
                    <div class="filter-actions">
                        <button class="btn btn-reset" id="resetFilters">重置筛选</button>
                        <button class="btn btn-apply" id="applyFilters">应用筛选</button>
                    </div>
                </div>
            </div>
            
            <!-- 快速筛选标签 -->
            <div class="quick-filters">
                <button class="quick-filter active">
                    <i class="fas fa-th"></i> 全部需求
                    <i class="fas fa-times remove-filter"></i>
                </button>
                <button class="quick-filter">
                    <i class="fas fa-clock"></i> 最新发布
                    <i class="fas fa-times remove-filter"></i>
                </button>
                <button class="quick-filter">
                    <i class="fas fa-fire"></i> 热门需求
                    <i class="fas fa-times remove-filter"></i>
                </button>
                <button class="quick-filter">
                    <i class="fas fa-map-marker-alt"></i> 附近需求
                    <i class="fas fa-times remove-filter"></i>
                </button>
                <button class="quick-filter">
                    <i class="fas fa-handshake"></i> 技能服务
                    <i class="fas fa-times remove-filter"></i>
                </button>
                <button class="quick-filter">
                    <i class="fas fa-exchange-alt"></i> 物品交换
                    <i class="fas fa-times remove-filter"></i>
                </button>
                <button class="quick-filter">
                    <i class="fas fa-plus-circle"></i> 更多筛选
                </button>
            </div>
            
            <!-- 结果统计和排序 -->
            <div class="results-stats">
                <div class="results-count">找到 <strong>1,284</strong> 个相关需求</div>
                
                <div class="sort-options">
                    <span class="sort-label">排序方式:</span>
                    <select class="filter-select" id="sortOptions" style="width: auto;">
                        <option value="recommended">推荐排序</option>
                        <option value="latest">最新发布</option>
                        <option value="popular">热门程度</option>
                        <option value="distance">距离最近</option>
                    </select>
                </div>
            </div>
            
            <!-- 需求列表 -->
            <div class="demands-list">
                <!-- 需求1: 左侧图片右侧内容布局 -->
                <div class="demand-card demand-side-by-side">
                    <div class="image-container">
                        <img src="https://picsum.photos/600/800?random=40" alt="二手自行车照片" class="demand-image">
                    </div>
                    
                    <div class="content-wrapper">
                        <div class="demand-header">
                            <div class="demand-author">
                                <img src="https://picsum.photos/100/100?random=5" alt="赵强的头像" class="author-avatar">
                                <div class="author-info">
                                    <div class="author-name">赵强</div>
                                    <div class="post-time">2小时前</div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="demand-content">
                            <h3 class="demand-title">转让9成新山地自行车，或换同等价值的公路自行车</h3>
                            
                            <div class="tags">
                                <span class="tag">二手交易</span>
                                <span class="tag">自行车</span>
                                <span class="tag">转让</span>
                            </div>
                            
                            <div class="demand-description">
                                去年购买的捷安特山地车，型号ATX777，橙色，9成新，骑行不到500公里。因想换公路车，故转让或交换。原价3298元，现1800元转让...
                            </div>
                        </div>
                        
                        <div class="demand-footer">
                            <div class="demand-stats">
                                <div class="stat-item">
                                    <i class="fas fa-eye"></i>
                                    <span>1254</span>
                                    <span>浏览</span>
                                </div>
                                <div class="stat-item">
                                    <i class="fas fa-comment"></i>
                                    <span>76</span>
                                    <span>评论</span>
                                </div>
                                <div class="stat-item">
                                    <i class="fas fa-map-marker-alt"></i>
                                    <span>杭州</span>
                                </div>
                            </div>
                            
                            <div class="demand-actions">
                                <button class="action-btn like-btn" data-id="1">
                                    <i class="fas fa-thumbs-up liked"></i>
                                    <span>189</span>
                                </button>
                                <button class="action-btn save-btn" data-id="1">
                                    <i class="far fa-bookmark"></i>
                                    <span>收藏</span>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 需求2: 无图片布局 -->
                <div class="demand-card demand-no-image">
                    <div class="demand-header">
                        <div class="demand-author">
                            <img src="https://picsum.photos/100/100?random=1" alt="李小明的头像" class="author-avatar">
                            <div class="author-info">
                                <div class="author-name">李小明</div>
                                <div class="post-time">5小时前</div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="demand-content">
                        <h3 class="demand-title">寻找Python开发合作伙伴，共同开发开源数据分析工具</h3>
                        
                        <div class="tags">
                            <span class="tag">Python</span>
                            <span class="tag">开源</span>
                            <span class="tag">数据分析</span>
                            <span class="tag">合作</span>
                        </div>
                        
                        <div class="demand-description">
                            我正在开发一个面向数据科学初学者的开源数据分析工具，旨在简化数据清洗和可视化流程。目前已有初步原型，希望找到有Python开发经验，熟悉Pandas、Matplotlib或Plotly的开发者共同完善...
                        </div>
                    </div>
                    
                    <div class="demand-footer">
                        <div class="demand-stats">
                            <div class="stat-item">
                                <i class="fas fa-eye"></i>
                                <span>328</span>
                                <span>浏览</span>
                            </div>
                            <div class="stat-item">
                                <i class="fas fa-comment"></i>
                                <span>24</span>
                                <span>评论</span>
                            </div>
                            <div class="stat-item">
                                <i class="fas fa-map-marker-alt"></i>
                                <span>北京</span>
                            </div>
                        </div>
                        
                        <div class="demand-actions">
                            <button class="action-btn like-btn" data-id="2">
                                <i class="far fa-thumbs-up"></i>
                                <span>42</span>
                            </button>
                            <button class="action-btn save-btn" data-id="2">
                                <i class="fas fa-bookmark saved"></i>
                                <span>已收藏</span>
                            </button>
                        </div>
                    </div>
                </div>
                
                <!-- 需求3: 单张图片布局 -->
                <div class="demand-card demand-single-image">
                    <div class="demand-header">
                        <div class="demand-author">
                            <img src="https://picsum.photos/100/100?random=2" alt="王芳的头像" class="author-avatar">
                            <div class="author-info">
                                <div class="author-name">王芳</div>
                                <div class="post-time">昨天 15:30</div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="image-container">
                        <img src="https://picsum.photos/800/450?random=10" alt="手工编织篮样品" class="demand-image">
                    </div>
                    
                    <div class="demand-content">
                        <h3 class="demand-title">求购手工编织篮，用于周末市集摆摊展示商品</h3>
                        
                        <div class="tags">
                            <span class="tag">手工制品</span>
                            <span class="tag">求购</span>
                            <span class="tag">编织</span>
                            <span class="tag">市集</span>
                        </div>
                        
                        <div class="demand-description">
                            本人周末会参加创意市集售卖手作饰品，需要5-8个中等大小的手工编织篮用于展示商品。希望风格简约自然，尺寸大约30×20×15cm左右...
                        </div>
                    </div>
                    
                    <div class="demand-footer">
                        <div class="demand-stats">
                            <div class="stat-item">
                                <i class="fas fa-eye"></i>
                                <span>512</span>
                                <span>浏览</span>
                            </div>
                            <div class="stat-item">
                                <i class="fas fa-comment"></i>
                                <span>37</span>
                                <span>评论</span>
                            </div>
                            <div class="stat-item">
                                <i class="fas fa-map-marker-alt"></i>
                                <span>上海</span>
                            </div>
                        </div>
                        
                        <div class="demand-actions">
                            <button class="action-btn like-btn" data-id="3">
                                <i class="fas fa-thumbs-up liked"></i>
                                <span>89</span>
                            </button>
                            <button class="action-btn save-btn" data-id="3">
                                <i class="far fa-bookmark"></i>
                                <span>收藏</span>
                            </button>
                        </div>
                    </div>
                </div>
                
                <!-- 需求4: 左侧图片右侧内容布局 -->
                <div class="demand-card demand-side-by-side">
                    <div class="image-container">
                        <img src="https://picsum.photos/600/800?random=50" alt="瑜伽课程宣传图" class="demand-image">
                    </div>
                    
                    <div class="content-wrapper">
                        <div class="demand-header">
                            <div class="demand-author">
                                <img src="https://picsum.photos/100/100?random=6" alt="林瑜伽的头像" class="author-avatar">
                                <div class="author-info">
                                    <div class="author-name">林瑜伽</div>
                                    <div class="post-time">3天前</div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="demand-content">
                            <h3 class="demand-title">寻找瑜伽爱好者共同租赁场地，分摊费用</h3>
                            
                            <div class="tags">
                                <span class="tag">瑜伽</span>
                                <span class="tag">活动</span>
                                <span class="tag">合租</span>
                                <span class="tag">健康</span>
                            </div>
                            
                            <div class="demand-description">
                                本人是瑜伽教练，想在朝阳区租赁一个小型工作室用于日常练习和小班教学，寻找3-5名瑜伽爱好者共同分摊场地费用，每人每月约600元，可自由使用场地...
                            </div>
                        </div>
                        
                        <div class="demand-footer">
                            <div class="demand-stats">
                                <div class="stat-item">
                                    <i class="fas fa-eye"></i>
                                    <span>456</span>
                                    <span>浏览</span>
                                </div>
                                <div class="stat-item">
                                    <i class="fas fa-comment"></i>
                                    <span>18</span>
                                    <span>评论</span>
                                </div>
                                <div class="stat-item">
                                    <i class="fas fa-map-marker-alt"></i>
                                    <span>北京</span>
                                </div>
                            </div>
                            
                            <div class="demand-actions">
                                <button class="action-btn like-btn" data-id="4">
                                    <i class="far fa-thumbs-up"></i>
                                    <span>67</span>
                                </button>
                                <button class="action-btn save-btn" data-id="4">
                                    <i class="far fa-bookmark"></i>
                                    <span>收藏</span>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 分页 -->
            <div class="pagination-container">
                <nav>
                    <ul class="pagination">
                        <li class="page-item disabled">
                            <a class="page-link" href="#" tabindex="-1"><i class="fas fa-chevron-left"></i></a>
                        </li>
                        <li class="page-item active"><a class="page-link" href="#">1</a></li>
                        <li class="page-item"><a class="page-link" href="#">2</a></li>
                        <li class="page-item"><a class="page-link" href="#">3</a></li>
                        <li class="page-item"><a class="page-link" href="#">4</a></li>
                        <li class="page-item"><a class="page-link" href="#">5</a></li>
                        <li class="page-item">
                            <a class="page-link" href="#"><i class="fas fa-chevron-right"></i></a>
                        </li>
                    </ul>
                </nav>
            </div>
        </div>
    </div>
    

    
    <!-- Bootstrap 5 JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <!-- Select2 JS -->
    <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
    
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 初始化Select2多选组件
            $('#categoryFilter').select2({
                placeholder: '选择需求分类',
                allowClear: true
            });
            
            $('#tagFilter').select2({
                placeholder: '选择相关标签',
                allowClear: true
            });

            
            // 筛选区域展开/收起
            const toggleFilterBtn = document.getElementById('toggleFilter');
            const filterContent = document.getElementById('filterContent');
            let filterExpanded = true;
            
            toggleFilterBtn.addEventListener('click', function() {
                filterExpanded = !filterExpanded;
                
                if (filterExpanded) {
                    filterContent.style.display = 'block';
                    toggleFilterBtn.innerHTML = '<i class="fas fa-chevron-up"></i><span>收起筛选</span>';
                } else {
                    filterContent.style.display = 'none';
                    toggleFilterBtn.innerHTML = '<i class="fas fa-chevron-down"></i><span>展开筛选</span>';
                }
            });
            
            // 快速筛选标签
            const quickFilters = document.querySelectorAll('.quick-filter:not(:last-child)');
            quickFilters.forEach(filter => {
                filter.addEventListener('click', function() {
                    // 处理"全部需求"的特殊情况
                    if (this.textContent.includes('全部需求')) {
                        quickFilters.forEach(f => f.classList.remove('active'));
                        this.classList.add('active');
                        showNotification('已显示全部需求');
                    } else {
                        this.classList.toggle('active');
                        const isActive = this.classList.contains('active');
                        showNotification(isActive ? 
                            `已筛选: ${this.textContent.trim().replace('×', '')}` : 
                            `已取消筛选: ${this.textContent.trim().replace('×', '')}`);
                    }
                });
            });
            
            // 移除筛选标签
            const removeFilters = document.querySelectorAll('.remove-filter');
            removeFilters.forEach(removeBtn => {
                removeBtn.addEventListener('click', function(e) {
                    e.stopPropagation();
                    const filterTag = this.closest('.quick-filter');
                    const filterText = filterTag.textContent.trim().replace('×', '');
                    filterTag.classList.remove('active');
                    showNotification(`已取消筛选: ${filterText}`);
                });
            });
            
            // 更多筛选按钮
            document.querySelector('.quick-filter:last-child').addEventListener('click', function() {
                filterContent.style.display = 'block';
                filterExpanded = true;
                toggleFilterBtn.innerHTML = '<i class="fas fa-chevron-up"></i><span>收起筛选</span>';
                
                // 滚动到筛选区域
                document.querySelector('.filters-section').scrollIntoView({
                    behavior: 'smooth'
                });
            });
            
            // 应用筛选
            document.getElementById('applyFilters').addEventListener('click', function() {
                // 获取所有筛选条件
                const categories = $('#categoryFilter').val() || [];
                const time = $('#timeFilter').val();
                const location = $('#locationFilter').val();
                const tags = $('#tagFilter').val() || [];
                const minPrice = document.getElementById('minPrice').value;
                const maxPrice = document.getElementById('maxPrice').value;
                const interaction = $('#interactionFilter').val();
                
                // 构建筛选消息
                let filterMessage = '已应用筛选: ';
                let filterCount = 0;
                
                if (categories.length > 0) {
                    filterMessage += `分类(${categories.length})、`;
                    filterCount++;
                }
                if (time !== 'all') {
                    filterMessage += '时间、';
                    filterCount++;
                }
                if (location !== 'all') {
                    filterMessage += '地区、';
                    filterCount++;
                }
                if (tags.length > 0) {
                    filterMessage += `标签(${tags.length})、`;
                    filterCount++;
                }
                if (minPrice || maxPrice) {
                    filterMessage += '价格、';
                    filterCount++;
                }
                if (interaction !== 'all') {
                    filterMessage += '互动量、';
                    filterCount++;
                }
                
                if (filterCount === 0) {
                    filterMessage = '未选择任何筛选条件';
                } else {
                    filterMessage = filterMessage.slice(0, -1);
                }
                
                showNotification(filterMessage);
                
                // 模拟加载筛选结果
                const demandsList = document.querySelector('.demands-list');
                demandsList.style.opacity = '0.5';
                
                setTimeout(() => {
                    demandsList.style.opacity = '1';
                    // 更新结果计数
                    document.querySelector('.results-count strong').textContent = 
                        Math.floor(Math.random() * 500) + 100;
                }, 800);
            });
            
            // 重置筛选
            document.getElementById('resetFilters').addEventListener('click', function() {
                $('#categoryFilter').val(null).trigger('change');
                $('#timeFilter').val('all');
                $('#locationFilter').val('all');
                $('#tagFilter').val(null).trigger('change');
                document.getElementById('minPrice').value = '';
                document.getElementById('maxPrice').value = '';
                $('#interactionFilter').val('all');
                
                showNotification('已重置所有筛选条件');
            });
            
            // 排序选项变化
            document.getElementById('sortOptions').addEventListener('change', function() {
                const sortText = this.options[this.selectedIndex].text;
                showNotification(`已按${sortText}排序`);
                
                // 模拟重新排序
                const demandsList = document.querySelector('.demands-list');
                demandsList.style.opacity = '0.5';
                
                setTimeout(() => {
                    demandsList.style.opacity = '1';
                }, 600);
            });
            
            // 点赞功能
            const likeButtons = document.querySelectorAll('.like-btn');
            likeButtons.forEach(btn => {
                btn.addEventListener('click', function() {
                    const icon = this.querySelector('i');
                    const countSpan = this.querySelector('span');
                    let count = parseInt(countSpan.textContent);
                    
                    if (icon.classList.contains('far')) {
                        // 点赞
                        icon.classList.remove('far');
                        icon.classList.add('fas', 'liked');
                        count++;
                        showNotification('点赞成功');
                    } else {
                        // 取消点赞
                        icon.classList.remove('fas', 'liked');
                        icon.classList.add('far');
                        count--;
                        showNotification('已取消点赞');
                    }
                    
                    countSpan.textContent = count;
                });
            });
            
            // 收藏功能
            const saveButtons = document.querySelectorAll('.save-btn');
            saveButtons.forEach(btn => {
                btn.addEventListener('click', function() {
                    const icon = this.querySelector('i');
                    const textSpan = this.querySelector('span');
                    
                    if (icon.classList.contains('far')) {
                        // 收藏
                        icon.classList.remove('far');
                        icon.classList.add('fas', 'saved');
                        textSpan.textContent = '已收藏';
                        showNotification('已收藏该需求');
                    } else {
                        // 取消收藏
                        icon.classList.remove('fas', 'saved');
                        icon.classList.add('far');
                        textSpan.textContent = '收藏';
                        showNotification('已取消收藏');
                    }
                });
            });
            
            // 分页功能
            const pageLinks = document.querySelectorAll('.page-link:not(.fas)');
            pageLinks.forEach(link => {
                link.addEventListener('click', function(e) {
                    e.preventDefault();
                    
                    // 移除所有活跃状态
                    document.querySelectorAll('.page-item').forEach(item => {
                        item.classList.remove('active');
                    });
                    
                    // 添加当前页活跃状态
                    this.closest('.page-item').classList.add('active');
                    
                    // 显示通知
                    showNotification(`已跳转到第${this.textContent}页`);
                    
                    // 模拟加载新页面
                    const demandsList = document.querySelector('.demands-list');
                    demandsList.style.opacity = '0.5';
                    
                    setTimeout(() => {
                        demandsList.style.opacity = '1';
                    }, 800);
                });
            });
            
            // 上一页/下一页
            const paginationArrows = document.querySelectorAll('.page-link .fas');
            paginationArrows.forEach(arrow => {
                arrow.closest('.page-link').addEventListener('click', function(e) {
                    e.preventDefault();
                    
                    if (!this.closest('.page-item').classList.contains('disabled')) {
                        const currentPage = document.querySelector('.page-item.active .page-link').textContent;
                        const newPage = arrow.classList.contains('fa-chevron-left') 
                            ? parseInt(currentPage) - 1 
                            : parseInt(currentPage) + 1;
                        
                        // 更新活跃状态
                        document.querySelectorAll('.page-item').forEach(item => {
                            item.classList.remove('active');
                        });
                        document.querySelectorAll('.page-link').forEach(link => {
                            if (link.textContent === newPage.toString()) {
                                link.closest('.page-item').classList.add('active');
                            }
                        });
                        
                        showNotification(`已跳转到第${newPage}页`);
                        
                        // 模拟加载新页面
                        const demandsList = document.querySelector('.demands-list');
                        demandsList.style.opacity = '0.5';
                        
                        setTimeout(() => {
                            demandsList.style.opacity = '1';
                        }, 800);
                    }
                });
            });
        });
    </script>
</body>
</html>
    
